/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rmiserver;

import java.io.Serializable;
import java.sql.Time;
import java.util.ArrayList;
import java.util.Date;

/**
 * Автобусный маршрут
 * @author alexxxey
 */
public class Trip implements Serializable
{    
    /**
     * Создание объекта 
     * @param tripDate - дата отправления
     * @param tripTime - время отправления
     * @param placeNum - число мест (доступных билетов)
     * @param dest - пункты назначения
     */
    public Trip(int tripId, Date tripDate, Time tripTime,
            int placesNum, ArrayList<String> dest)
    {
        m_tripId = tripId;
        m_tripDate = tripDate;
        m_tripTime = tripTime;
        m_placesNum = placesNum;              
        m_destinations = new ArrayList<>(dest);
    }
    
    public Trip()
    {
        m_destinations = new ArrayList<>();
    }
    
    public int getTripId() { return m_tripId; }
    public void setTripId(int tripId) { m_tripId = tripId; }
    
    public Date getDate() { return m_tripDate; }
    public void setDate(Date tripDate) { m_tripDate = tripDate; }
    
    public Time getTime() { return m_tripTime; }  
    public void setTime(Time tripTime) { m_tripTime = tripTime; }
            
    public int getPlacesNum() { return m_placesNum; }    
    public void setPlacesNum(int placesNum) { m_placesNum = placesNum; }
    
    public ArrayList<String> getDestinations() { return m_destinations; }
    public void setDestinations(ArrayList<String> dest) { 
        m_destinations = new ArrayList<>(dest); 
    }
    
    /**
     * Информация о маршруте в виде строки
     * @return 
     */
    public String getInfo()
    {
        return new String("Маршрут №" + m_tripId + ", " +
                m_tripDate + " " + m_tripTime + ", " +
                m_destinations.toString());
    }
  
            
    private int m_tripId;    
    private Date m_tripDate;
    private Time m_tripTime;
    private int m_placesNum;
    private ArrayList<String> m_destinations;
}
